package OOP.day07;


class Student {
    String name;
    int age;
    String className;
    String studentId;

    // 无参构造方法
    public Student() {
    }

    // 有参构造方法
    public Student(String name, int age, String className, String studentId) {
        this.name = name;
        this.age = age;
        this.className = className;
        this.studentId = studentId;
    }

    // 成员方法
    void study() {
        System.out.println("学生" + this.name + "正在学习……");
    }

    void sayHi() {
        System.out.println("大家好，我是" + name + "，今年" + age + "岁了，我正在" + className + "学习");
    }

    void printId() {
        System.out.println("学生" + name + "的学号是" + studentId);
    }
    void playWith(String studentName){
        System.out.println("学生" + name + "和" + studentName + "在玩游戏");
    }
}
